import CryptoJS from "./crypto-js.min";
let key = "1s34!D781o0.5ln8";
key = CryptoJS.enc.Utf8.parse(key);
//加密
function encrypt(message) {
  return CryptoJS.AES.encrypt(message, key, {
    mode: CryptoJS.mode.ECB,
    padding: CryptoJS.pad.Iso10126,
  }).toString();
}
//解密
function decrypt(message) {
  return CryptoJS.AES.decrypt(message, key, {
    mode: CryptoJS.mode.ECB,
    padding: CryptoJS.pad.Iso10126,
  }).toString(CryptoJS.enc.Utf8);
}
let CryptoUtil = {
  encrypt: encrypt,
  decrypt: decrypt,
};
export default CryptoUtil;
